<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../layui273/layui.js"></script>
    <link href="../layui273/css/layui.css" rel="stylesheet">
</head>
<body>
<table id="assessmentResultsStatistics-table"></table>

<script>
    const data = [
        {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "太平",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "44",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "彰武",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "39",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "细河",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "41",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "海州",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "43",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "阜蒙",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "38",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "市南",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "40",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }, {
            "groupId": null,
            "indexTotalScore": "50",
            "aType": null,
            "status": null,
            "taskAddPoints": "0",
            "orderCode": null,
            "accountabilityMinusPoints": "0",
            "specialContributionAddPoints": "0",
            "okr": "0",
            "taskTotalScore": "100",
            "coefficient": "1",
            "totalScore2": null,
            "isScore": null,
            "depAddPoints": null,
            "unitAddPoints": null,
            "id": null,
            "groupingName": "基层四组",
            "depName": "清河门",
            "keyIndicatorsScoreTwo": "80",
            "synergyIndicatorsTwo": "20",
            "keyIndicatorsScore": "80",
            "synergyIndicators": "20",
            "depId": "42",
            "depType": null,
            "leadTaskScore": "100",
            "leadTaskScoreTwo": "100",
            "collaborativeTask": null,
            "collaborativeTaskTwo": null,
            "minusPoints": null,
            "addPoints": null,
            "totalScore": "150",
            "buildStatus": null,
            "createName": null,
            "creaeDate": null,
            "remarks": "45",
            "month": null
        }];
    layui.use(['table'], function () {
        var table = layui.table;
        var MODULE_PATH = 'http://192.168.31.143:8090/BigScreenController/';
        var cols = [
            [
                {title: '序号', align: 'center', type: 'numbers', rowspan: 3, width: 60,},
                {title: '基层单位', align: 'center', rowspan: 2,},
                {

                    title: '指标考核',
                    align: 'center',
                    colspan: 3,
                },
                {
                    title: '任务考核',
                    align: 'center',
                    colspan: 5
                },
                {
                    title: '问责减分项（最多扣5分）',
                    rowspan: 2,
                    align: 'center',
                },
                {
                    title: '加分项（最多加5分）',
                    rowspan: 2,
                    align: 'center',
                },
                {
                    title: 'OKR最多加2分）',
                    rowspan: 2,
                    align: 'center',
                },
                {
                    title: '考核最终得分',
                    align: 'center',
                    rowspan: 2,
                },
                {
                    title: '等级', align: 'center', rowspan: 2
                },
            ],
            [
                //指标考核
                {title: '一级指标<br>（标准分60）', align: 'center',},
                {title: '二级指标<br>（标准分10）', align: 'center',},
                {title: '指标总分<br>（标准分70）', align: 'center',},
                //任务考核
                {title: '一级任务<br>（标准分24）', align: 'center',},
                {title: '二级任务<br>（标准分6）', align: 'center',},
                {title: '数量系数Kn', align: 'center',},
                {title: '质量加分Q', align: 'center'},
                {title: '任务总分<br>（标准分30）', align: 'center',},
            ],
            [
                {field: 'depName', title: '栏次', align: 'center', width: 160},
                {field: 'keyIndicatorsScoreTwo', title: '1', align: 'center', width: 120,},
                {field: 'synergyIndicatorsTwo', title: '2', align: 'center', width: 120,},
                {field: 'indexTotalScore', title: '3=1+2', align: 'center', width: 120,},
                {field: 'leadTaskScoreTwo', title: '4', align: 'center', width: 120,},
                {field: 'collaborativeTaskTwo', title: '5', align: 'center', width: 120,},
                {field: 'coefficient', title: '6', align: 'center', width: 120,},
                {field: 'taskAddPoints', title: '7', align: 'center', width: 120,},
                {field: 'taskTotalScore', title: '8=4*5+6', align: 'center', width: 120,},
                {
                    field: 'indexTotalScore', title: '9', align: 'center', width: 120
                },
                {
                    field: 'leadTaskScoreTwo', title: '10', align: 'center', width: 120
                },
                {
                    field: 'collaborativeTaskTwo', title: '11', align: 'center', width: 120
                },
                {field: 'totalScore', title: '12=3+7+8+9+10', align: 'center', width: 120,},
                {
                    field: 'taskAddPoints', title: '13', align: 'center', width: 120,
                },
            ],
        ]

        //四舍五入保留2位小数（不够位数，则用0替补）
        function keepTwoDecimalFull(num) {
            var result = parseFloat(num);
            if (isNaN(result)) {
                alert('传递参数错误，请检查！');
                return false;
            }
            result = Math.round(num * 100) / 100;
            var s_x = result.toString(); //将数字转换为字符串

            var pos_decimal = s_x.indexOf('.'); //小数点的索引值


            // 当整数时，pos_decimal=-1 自动补0
            if (pos_decimal < 0) {
                pos_decimal = s_x.length;
                s_x += '.';
            }

            // 当数字的长度< 小数点索引+2时，补0
            while (s_x.length <= pos_decimal + 2) {
                s_x += '0';
            }
            return s_x;
        }

        //table表单列表
        table.render({
            elem: '#assessmentResultsStatistics-table',
            // url: MODULE_PATH + 'assessmentResultsList?remarks=7',
            // page: false,
            // method: 'get',
            cols: cols,
            data
        });
    });

</script>
</body>
</html>
